package com.qf.controller;

import com.qf.pojo.Topic;
import com.qf.pojo.resp.BaseResult;
import com.qf.service.TopicService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/topic")
public class TopicController {

    @Resource
    TopicService topicService;

    @RequestMapping("/findAllTopic")
    public BaseResult findTopic(){
        List<Topic> topicList=topicService.findAllTopic();
        BaseResult baseResult = new BaseResult();
        baseResult.setCode(1);
        baseResult.setData(topicList);
        return baseResult;
    }
}
